import pymysql

db = pymysql.connect(
    host="localhost",
    port=3306,
    user="root",
    database="crawlerdemo",
    password="123456",
    charset="utf8"
)

cursor = db.cursor()

cursor.execute("select * from m_stu")
print(cursor)
# data = cursor.fetchone()
data = cursor.fetchall()
print(data)


cursor.close()

db.close()